package com.eco.fanliapp.admin.controller.web;


import com.eco.fanliapp.admin.annotation.SysLogAnnotation;
import com.eco.fanliapp.admin.common.BaseController;
import com.eco.fanliapp.common.response.ServerResponse;
import com.eco.fanliapp.entity.MsgTemplate;
import com.eco.fanliapp.service.IMsgTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MsgTemplateController extends BaseController {


    @Autowired
    private IMsgTemplateService msgTemplateService;

    /**
     * 消息保存
     * @return
     */
    @SysLogAnnotation(value = "模板消息保存",userType = 2)
    @RequestMapping(method = RequestMethod.POST, value = "/msg/template/save")
    public ServerResponse add(@RequestBody MsgTemplate msgTemplate){
        return msgTemplateService.saveMsgTemplate(msgTemplate);
    }

    @RequestMapping(method = RequestMethod.GET, value = "/msg/template/find/msg/template/all")
    public ServerResponse findMsgTemplateAll(){
        return msgTemplateService.findMsgTemplateAll();
    }

}
